using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EuropeEngulfed.NET
{
    partial class PathSelectionDialog : Form
    {
        private int indexSelected = 0;
        List<List<MapInfo.RegionID>> listOfPaths;

        public int IndexSelected
        {
            get
            {
                return indexSelected;
            }
        }

        public PathSelectionDialog(string title,List<List<MapInfo.RegionID>> listOfPaths)
        {
            InitializeComponent();
            this.Text = title;
            this.listOfPaths = listOfPaths;
            foreach (List<MapInfo.RegionID> path in listOfPaths)
            {
                string pathName = "";
                foreach(MapInfo.RegionID regionID in path)
                {
                    if (pathName == "")
                    {
                        pathName += Enum.GetName(typeof(MapInfo.RegionID), regionID);
                    }
                    else
                    {
                        pathName += "->";
                        pathName += Enum.GetName(typeof(MapInfo.RegionID), regionID);
                    }
                }
                this.pathsComboBox.Items.Add(pathName);
            }
            this.pathsComboBox.SelectedItem = this.pathsComboBox.Items[0];
        }

        private void OkButton_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            indexSelected = this.pathsComboBox.SelectedIndex;
            this.Close();
        }
    }
}